home *** CD-ROM | disk | FTP | other *** search
- -- card: 3167 from stack: in.32
- -- bmap block id: 4210
- -- flags: 4000
- -- background id: 2738
- -- name: First Card
- ----- HyperTalk script -----
- on startUp
- set userLevel to 1
- hide message box
- hide menuBar
- end startUp
-
- on openCard
- set userLevel to 1
- hide message box
- hide menuBar
- end openCard
-
-
- -- part 1 (button)
- -- low flags: 00
- -- high flags: 2003
- -- rect: left=4 top=296 right=333 bottom=45
- -- title width / last selected line: 65535
- -- icon id / first selected line: -15184 / 50352
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: How Many?
- ----- HyperTalk script -----
- on mouseUp
- get number of cards
- subtract 1 from It
- set location of message box to 19,134
- put it && " Mac using packet hams are listed in this stack." into message
- end mouseUp
-
-
-
- -- part 2 (button)
- -- low flags: 00
- -- high flags: 2003
- -- rect: left=4 top=296 right=333 bottom=45
- -- title width / last selected line: 65535
- -- icon id / first selected line: -15184 / 50352
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: How Many?
- ----- HyperTalk script -----
- on mouseUp
- get number of cards
- subtract 1 from It
- set location of message box to 19,134
- put it && " Mac using packet hams are listed in this stack." into message
- end mouseUp
-
-
-
- -- part 3 (button)
- -- low flags: 00
- -- high flags: A003
- -- rect: left=449 top=304 right=325 bottom=511
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Author
- ----- HyperTalk script -----
- on mouseUp
- flash 2
- wait 10 ticks
- ask " Created by Ray Terry - N6PHJ " with " SysOp of MacScience BBS (408) 247-8307 "
- end mouseUp
-
-
- -- part 4 (button)
- -- low flags: 00
- -- high flags: 2001
- -- rect: left=404 top=180 right=197 bottom=428
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: New Button
- ----- HyperTalk script -----
- on mouseUp
- set userlevel to 5
- show menubar
- end mouseUp
-
-
-
- -- part 5 (button)
- -- low flags: 00
- -- high flags: A001
- -- rect: left=22 top=210 right=253 bottom=53
- -- title width / last selected line: 65535
- -- icon id / first selected line: -15186 / 50350
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: to text
- ----- HyperTalk script -----
- function fixfield s -- convert field s into exportable form,
- global fsep -- field separator character
- global rsep -- record separator character
- put false into quoted -- true if we need to quote the string
- put false into hasquotes -- true if string s contains quotes
-
- if offset(quote, s) <> 0 then
- put true into quoted
- put true into hasquotes
- else
- if offset("," , s) <> 0 then
- put true into quoted
- else
- if offset(tab, s) <> 0 then
- put true into quoted
- else
- if offset(return,s) <> 0 then
- put true into quoted
- else
- if offset (fsep,s) <> 0 then
- put true into quoted
- else
- if offset (rsep, s) <> 0 then
- put true into quoted
- end if
- end if
- end if
- end if
- end if
- end if
-
- if hasquotes then -- convert all quotes to doubled quotes
- put empty into outstr -- will hold fixed-up string
- put s into t -- use a copy
- repeat
- put offset(quote, t) into p
- if p = 0 then -- no more quotes
- put t after outstr -- copy rest of t
- exit repeat
- end if
- put char 1 to p of t after outstr -- copy up to quote
- put quote after outstr -- add another quote
- put char p+1 to length(t) of t into temp -- rest of t after quote
- put temp into t
- end repeat
- else
- put s into outstr
- end if
- if quoted then
- return quote & outstr & quote
- else
- return outstr
- end if
- end fixfield
-
- on mouseUp -- export a stack to a text file
- global fsep -- field separator character
- global rsep -- record separator character
- global cardfields -- false if exporting only background fields
- global firstline -- true if first export line has field names
- global mailmerge -- true if exporting with quotes around special chars
-
- if fsep = empty then put tab into fsep -- initialize globals if needed
- if rsep = empty then put return into rsep
- if cardfields = empty then put false into cardfields
- if firstline = empty then put true into firstline
- if mailmerge = empty then put true into mailmerge
-
- put the short name of this stack && "Export" into temp -- default name
- ask "Name of output file?" with temp
- if length(it) = 0 then exit mouseup -- user cancelled
- put it into filenam
- open file filenam
-
- go card 1
-
- set lockScreen to true
- set cursor to 4 -- watch cursor
-
- if firstline then -- write field names
- put "Exporting field names" -- keep user informed
- put number of fields into nfields
- put number of card fields into cfields
- put nfields + cfields into allfields
- repeat with i = 1 to nfields -- first do background field names
- put the short name of field i into s
- if mailmerge then
- put fixfield(s) into temp -- convert s to mail merge format
- write temp to file filenam
- else
- write s to file filenam
- end if
- if (i < nfields) or (cardfields and i < allfields) then
- write fsep to file filenam
- else
- write rsep to file filenam
- end if
- end repeat
- if cardfields then -- write card field names if flag is set
- repeat with i = 1 to cfields
- put the short name of card field i into s
- if mailmerge then
- put fixfield(s) into temp
- write temp to file filenam
- else
- write s to file filenam
- end if
- if i < cfields then
- write fsep to file filenam
- else
- write rsep to file filenam
- end if
- end repeat
- end if
- end if -- if firstline
-
- put number of cards into numcards
- repeat with i = 1 to numcards -- write the cards
- put "Exporting card " & i -- keep user informed
- put number of fields into nfields
- put number of card fields into cfields
- put nfields + cfields into allfields
- repeat with j = 1 to nfields -- write the background fields
- put field j into s
- if mailmerge then
- put fixfield(s) into temp
- write temp to file filenam
- else
- write s to file filenam
- end if
- if (j < nfields) or (cardfields and j < allfields) then
- write fsep to file filenam
- else
- write rsep to file filenam
- end if
- end repeat
- if cardfields then -- write the card fields if flag is set
- repeat with j = 1 to cfields -- write the card fields
- put card field j into s
- if mailmerge then
- put fixfield(s) into temp
- write temp to file filenam
- else
- write s to file filenam
- end if
- if j < cfields then
- write fsep to file filenam
- else
- write rsep to file filenam
- end if
- end repeat
- end if
- go next card -- done with one card, advance to next
- end repeat -- i = 1 to numcards
-
- close file filenam
- set lockScreen to false
- put "All done, " & numcards & " cards total"
- end mouseUp
-
-
-
- -- part contents for background part 24
- ----- text -----
-
-
-
-